﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Ryder_US_Website.BUS;
using Ryder_US_Website.Utils;

namespace Ryder_US_Website.Presentation.Admin
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            String username = txtUsername.Text;
            String password = txtPassword.Text;
            try
            {
                RUS_User user = UserBUS.Login(username, password);
                Session.Add("RUS_User", user);
                Response.Redirect("Home.aspx");
            }
            catch (Exception ex)
            {
                UtilHelpers.ShowMessage(ex.Message);
            }
        }
    }
}
